<cfsilent>
	<cfif structKeyExists(request,"session") and structKeyExists(request.session,'user') and request.session.user.id neq "">
		<!--- see if a full sync is in order --->
		<cfset options = application.helpers.run.it('optionService.getOptions',{key='calendar'}) />
		<cfif options.refresh_token neq "">
			<cfif options.force_google_sync eq 0>
				<cfset application.helpers.run.it('googleService.checkSyncCalendar') />
			<cfelse>
				<cfset application.helpers.run.it('googleService.fullSync') />
			</cfif>
		</cfif>
	</cfif>
</cfsilent>

<!DOCTYPE HTML>
<html>
	<head>
		<meta content="True" name="HandheldFriendly">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta name="viewport" content="width=device-width">
		<meta name="description" content="Craftivity is goal setting and productivity software for creative professionals. Want to make the most out of the time you spend on your business? Give us a try!">
		<title>Craftivity: Today is your most productive day!</title>
		<cfoutput>
			#application.core.includeScripts(craftivity="true")#
		</cfoutput>
	</head>
	<body>
		<!--- detectDST on client computer using JS --->
		<script>
			<cfoutput>
				var serverDST = #request.session.user.dst#;
			</cfoutput>
			var today = new Date();
			// calculate 0 or 1
			if(today.dst()){
				var dst = 1;
			} else {
				var dst = 0;
			}
			Cookie.set('clientDST',dst,2);
		</script>
		<cfif application.devmode or request.session.user.admin eq 1>
			<cfoutput>
				<i class="fa fa-globe initSite" onclick="$('form[name=init_site]').submit();"></i>
					#$.render.form(name='init_site',class='hidden',method='craftivityController.initSite')#
				</form>
			</cfoutput>
		</cfif>

		<div id="results" class="hidden"></div>
		<div id="fb-root"></div>